using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Messaging;


namespace Pixysoft.Framework.Logs.Core
{
    internal class LoggerProperty : IContextProperty, IContributeObjectSink
    {
        string id;

        string module = null;

        private LoggerProperty() { }

        public LoggerProperty(string id, string module)
        {
            this.id = id;

            this.module = module;
        }


        public void Freeze(Context newContext)
        {
        }

        public bool IsNewContextOK(Context newCtx)
        {
            return true;
        }

        public string Name
        {
            get { return "LoggerProperty"; }
        }

        public IMessageSink GetObjectSink(MarshalByRefObject o, IMessageSink next)
        {
            try
            {
                return new LoggerAspect(o, next, id, module);
            }
            catch
            {
                return new DummyAspect(next);
            }
        }


    }
}
